<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<script>
			//求1-100的和
			var sum = 0;	//和
			for (var i=1; i<=100; i++) {
				sum = sum+i;
				//document.write(sum+"<br />");		//观察sum变化
			}
			
			document.write("<h1>1~100的和为["+sum+"]</h1>");
			document.write("<hr />");
			
			//10!(阶乘)		=>    1*2*3*4*5*6*7*8*9*10
			
		   var sum = 1;
		   for(var i=1;i<=10;i++){
                 sum *= i;
		   }
		     
			document.write(sum);
		
		</script>
	</body>
</html>
